package com.stoneframe.example.reids;

import java.io.Serializable;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("smsMessageDelegateListener")
public class SmsMessageDelegateListener {
	
	//@Autowired
	//private SmsQueueService smsQueueService;
	
	public void handleMessage(Serializable message){
		if(message instanceof SmsMessageVo){
			SmsMessageVo messageVo=(SmsMessageVo)message;
			if(messageVo.getType()==1){//发送短信
				
			}
			
			final Integer smsId=messageVo.getSmsId();
			Executor executor=Executors.newSingleThreadExecutor();
			executor.execute(new Runnable(){

				public void run() {
					// TODO Auto-generated method stub
					//异步更新短信表状态为发送成功
				}
				
			});
			
		}
	}

}
